Skip to content

Conversation

@jan-elastic
Copy link
Contributor

various small fixes

@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label v9.1.0 labels Apr 4, 2025
@jan-elastic jan-elastic added :ml Machine learning Team:ML Meta label for the ML team auto-backport Automatically create backport pull requests when merged v8.18.1 v8.19.0 v9.0.1 v8.17.5 >non-issue and removed needs:triage Requires assignment of a team area label labels Apr 4, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

* @param reason may contain a human-readable explanation for the current state
* @param startTime the time when the assignment was created
* @param maxAssignedAllocations used for adaptive allocations
* @param maxAssignedAllocations keeps track of the maximum number of allocations used for this assignment
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what this is exactly used for. It looks like only for recording, not for decision making. Definitely not used by adaptive allocations.

}
if (assignmentStates.get(deploymentId) != AssignmentState.STARTED) {
logger.debug(
"adaptive allocations scaler: skipping scaling [{}] because it is in [{}] state.",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating a model that's not in the STARTED state leads to errors in the logs.

this.nodes = nodes.stream().sorted(Comparator.comparing(Node::id)).toList();
this.deployments = deployments.stream().sorted(Comparator.comparing(AssignmentPlan.Deployment::deploymentId)).toList();
this.deployments = deployments.stream()
.filter(deployment -> deployment.allocations() > 0)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these aren't filtered, computePlan will

Plan with at least one allocation for previously assigned models

@jan-elastic jan-elastic merged commit 24909ca into main Apr 7, 2025
18 checks passed
@jan-elastic jan-elastic deleted the adaptive-allocations-improvements branch April 7, 2025 06:46
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.18 Commit could not be cherrypicked due to conflicts
8.x Commit could not be cherrypicked due to conflicts
9.0
8.17 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 126307

elasticsearchmachine pushed a commit that referenced this pull request Apr 7, 2025
* Adaptive allocations: don't update deployments that aren't started.

* AssignmentPlanner: don't plan deployments with zero allocations

* Update JavaDoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged backport pending :ml Machine learning >non-issue Team:ML Meta label for the ML team v8.17.5 v8.18.1 v8.19.0 v9.0.1 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants